﻿--HEADER Diary Entry To Idea 
CREATE TABLE [iPerform].[DiaryEntryToIdea](
    [DiaryEntryId] INT NOT NULL,
    [IdeaId]            UNIQUEIDENTIFIER NOT NULL, 
   
);
GO
ALTER TABLE [iPerform].[DiaryEntryToIdea]
    ADD CONSTRAINT [PK_DiaryEntryToIdea] PRIMARY KEY CLUSTERED ([DiaryEntryId] ASC, [IdeaId] ASC);
GO
ALTER TABLE [iPerform].[DiaryEntryToIdea]
 ADD CONSTRAINT [FK_DiaryEntryToIdea_DiaryEntry] FOREIGN KEY (DiaryEntryId) REFERENCES [iPerform].[DiaryEntry](Id);
GO
ALTER TABLE [iPerform].[DiaryEntryToIdea] 
ADD CONSTRAINT [FK_DiaryEntryToIdea_Idea] FOREIGN KEY (IdeaId) REFERENCES [iPerform].[Idea](Id);